Discrete calculus